<template>
  <div>
    <button @click="comName = 'UserAcc'">显示UserAcc</button>
    <button @click="comName = 'UserInfo'">显示UserInfo</button>

    <!-- is 指定组件名 会将对应组件名的组件渲染到此处 修改 comName 会动态切换对应的组件 -->

    <component :is="comName" />
  </div>
</template>

<script>
import UserAcc from "./components/UserAcc.vue";
import UserInfo from "./components/UserInfo.vue";
export default {
  components: {
    UserAcc,
    UserInfo,
  },
  data() {
    return {
      comName: "UserAcc",
    };
  },

  methods: {},
};
</script>

<style scoped>
</style>